package com.xygz.orm.constants;

/**
 * 错误消息定义
 *
 * @author xiyuan-lgz 2023-11-01 @version v1.0.0 新建与整理
 */
@SuppressWarnings("all")
public interface ErrorMessages {
    public static final String STACK_OVERFLOW_ERROR_CHECK_MSG = "Cannot add parameters that will cause Stack Overflow Error.";
    public static final String CLOSE_LOOP_BUILDING_SQL = "Closed loop recursion during SQL construction";
    public static final String FMT_CANNOT_PARSE_TABLE_CLS = "Unable to parse table。class: %s";
    public static final String NO_DATASOURCE = "no datasource.";
    public static final String NO_IMPLEMENTED = "Not implemented";
    public static final String UNSUPPORTED_OPERATION = "Unsupported operation";
    public static final String NOT_FOUND_DB_FMT = "not found datasource: %s";
    public static final String FMT_UNSUPPORTED_DB = "unsupported database type: %s";
    public static final String FMT_UNSUPPORTED_DB_TYPE = "orm unsupported database type: %s";
    public static final String FMT_UNSUPPORTED_CLS = "ORM unsupported build class: %s";
    public static final String ERR_PARAM_ID = "orm param.id cannot be null or empty.";
    
    public static final String FMT_REGISTERED_DB = "ORM database [%s] already registered.";
    public static final String ORM_PARAM_NOT_NULL = "ORMParameter cannot be null.";
    public static final String ORM_PARAM_ID_NOT_NULL = "ORMParameter.id cannot be null.";
    public static final String ORM_PARAM_URL_NOT_NULL = "ORMParameter.url cannot be null.";
    public static final String ORM_PARAM_DRIVER_NOT_NULL = "ORMParameter.driver cannot be null.";
    
    public static final String FMT_3_SEL_ITEM_MULTI_KEY_ERROR = "Class [%s] defines multiple primary keys, please use the .%s(Class, Selector) or .%s(Selector).";
    
    /**
     * 类xxx没有配置主键，请检查是否配置了@PrimaryKey注释或使用 .item((Class, Selector)方法
     */
    public static final String FMT_3_SEL_ITEM_NO_KEY_ERROR = "Class [%s] does not have a primary key configured. Please check if the @PrimaryKey annotation is configured or use .%s(Class, Selector) or .%s(Selector).";
    
    /**
     * 事务服务不能为空
     */
    public static final String TX_ID_NOT_BLANK = "The transaction service number cannot be blank.";
    
    /**
     * 找不到事务服务：%s
     */
    public static final String FMT_TX_ID_NOT_FOUND = "Unable to find transaction service: %s";
    
    /**
     * 不支持的结果类型：%s
     */
    public static final String FMT_UNSUPPORTED_RESULT_TYPE = "Unsupported result type: %s";
    
    /**
     * class %s 上的注解 value 不能为空
     */
    public static final String FMT_NOT_VALUE_ON_ANNOTATION_CLS = "Table annotation 'value' cannot be empty.  class: %s.";
    
    /**
     * 自增字段“%s”只能是数字类型。类：%s
     */
    public static final String FMT_INCREMENT_FIELD_MUST_NUMBER_TYPE = "The self increasing field '%s' can only be of numerical type. class: %s.";
    
    /**
     * 逐渐必须是数字类型或者 string 类型
     */
    public static final String PRIMARY_KEY_TYPE_MUST_BE_NUMBER_OR_STRING = "The primary key must be of numeric or string type.";
    
    public static final String VALUE_NOT_NULL = "The value cannot be null.";
    public static final String NO_COL_IN_CONDITION = "The 'in' condition must specify a column.";
    public static final String ERR_MULTI_COL_IN_CONDITION_FMT = "The 'in' condition can only contain one column, but %s columns were found.";
    public static final String INVALID_SPECIFICATION = "Conditional data value does not conform to specification";
    
    /**
     * in条件不支持的值类型
     */
    public static final String FMT_IN_CONDITION_UNSUPPORT_VALUE_TYPE = "'IN' condition unsupported value type: %s";
    
    public static final String UNSUPPORTED_CONDITION_FMT = "Unsupported SQL conditions: %s";
    
    /**
     * 在类中找不到 列信息
     */
    public static final String FMT_NOT_FOUND_COL = "not found column: '%s'";
    
    /**
     * 不能查询 注解为不存在的列
     */
    public static final String FMT_CANNOT_SELECT_NOT_EXISTS_COL = "Cannot query columns with non-existent annotations. class: '%s'";
    
    /**
     * select 语句至少包含1个列
     */
    public static final String SELECT_MUST_CONTAIN_1_COLUMN = "The select statement must contain at least one column.";
    
    /**
     * 别名不允许为空
     */
    public static final String ALIAS_NOT_EMPTY = "alias cannot be empty.";
    
    /**
     * SQL表达式SQL参数的数量与传递的参数的数量不一致
     */
    public static final String EXPRESSION_PARAM_COUNT_NOT_MATCH = "SQL expression The number of SQL parameters is inconsistent with the number of passed parameters.";
    
    /**
     * 没有需要更新的字段
     */
    public static final String NO_FIELDS_TO_UPDATE = "No fields to update";
    
    /**
     * 实体类型 [% s] 与原始类型 [%s] 不匹配
     */
    public static final String FMT_SUB_TYPE_NOT_MATCH_ORIGINAL_TYPE = "Entity type [%s] does not match original type [%s]";
    
    /**
     * 类没有配置主键注解：  @PrimaryKey
     */
    public static final String FMT_TABLE_NOT_CONFIGURED_PRIMARY_KEY = "Class: %s has no primary key annotation configured: @PrimaryKey";
    
    /**
     * 类%s配置了多主键，请使用 Selector方式进行操作，例如：delete(class, Selector), item(class,Selector)，delete(Selector), item(Selector) 方法
     */
    public static final String FMT_UNSUPPORT_OPT_MULTIPLE_PRIMARY_KEY = "Class: '%s' has multiple primary keys configured, please use Selector method to operate, for example: delete(class, Selector), item(class, Selector),delete(Selector), item(Selector)";
    
    
    /**
     * 不允许删除全表数据，如需删除全表数据请使用truncate方法。
     */
    public static final String CANT_DELETE_DATA_BY_NO_CONDITION = "You cannot delete full table data. To delete full table data, use the truncate method.";
}
